package registration;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class RegistrationAdapter extends FragmentPagerAdapter 
{
	final List<Fragment> registration_fragment_list;
	final Registration_Step_0 frag_step_0;
	final Registration_Step_1 frag_step_1;
    final Registration_Step_2 frag_step_2;

	public RegistrationAdapter(FragmentManager fm) 
	{
		super(fm);
		
		frag_step_0 = new Registration_Step_0();
		frag_step_1 = new Registration_Step_1();
        frag_step_2 = new Registration_Step_2();
		
		registration_fragment_list = new ArrayList<Fragment>();
		registration_fragment_list.add(frag_step_0);
		registration_fragment_list.add(frag_step_1);
        registration_fragment_list.add(frag_step_2);
	}

	@Override
	public Fragment getItem(int index) 
	{
		return registration_fragment_list.get(index);
	}

	@Override
	public int getCount() 
	{
		return registration_fragment_list.size();
	}

    public boolean StepsOk()
    {
        return frag_step_0.StepOk() && frag_step_1.StepOk(); // && frag_step_2.StepOk();
    }
}
